// 安装 @types/vue-router 以解决类型声明问题，若已安装可忽略此注释
import { createRouter, createWebHistory } from 'vue-router'
import Discover from '../views/Discover.vue' // 需创建对应视图组件
import Channel from '../views/Channel.vue'
import Mine from '../views/Mine.vue'
import Search from '../views/Search.vue'
import PlaybackPage from '../views/PlaybackPage.vue' // 新增：导入播放页组件

const routes = [
  { path: '/', component: Discover },
  { path: '/discover', component: Discover },
  { path: '/channel', component: Channel },
  { path: '/mine', component: Mine },
  { path: '/search', component: Search },
  { // 新增：播放页路由
    path: '/movie/:id', 
    name: 'Playback',
    component: PlaybackPage 
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router